package com.cloud.pole.shop.service.goods.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloud.pole.shop.biz.goods.ShopGoodsGroupRecommBiz;
import com.cloud.pole.shop.model.entity.goods.ShopGoodsGroup;
import com.cloud.pole.shop.model.entity.goods.ShopGoodsGroupRecomm;
import com.cloud.pole.shop.service.goods.GoodsGroupRecommService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Service
public class GoodsGroupRecommServiceImpl implements GoodsGroupRecommService {

	@Autowired
	private ShopGoodsGroupRecommBiz shopGoodsGroupRecommBiz;

	@Override
	public PageInfo<ShopGoodsGroupRecomm> selectPageShopGoodsGroupAdminList(Integer pageNo, Integer pageSize,Integer shopId)
			throws Exception {
		PageHelper.startPage(pageNo, pageSize);
		List<ShopGoodsGroupRecomm> groupListOr = shopGoodsGroupRecommBiz.groupListOr(shopId);
		PageInfo<ShopGoodsGroupRecomm> page = new PageInfo<ShopGoodsGroupRecomm>(groupListOr);
		return page;
	}

	@Override
	public List<ShopGoodsGroupRecomm> selectByShopId(Integer shopId) throws Exception {
		
		return shopGoodsGroupRecommBiz.selectByShopId(shopId);
	}

	@Override
	public void addList(List<ShopGoodsGroupRecomm> shopGoodsGroupRecomm) throws Exception {
		
		shopGoodsGroupRecommBiz.addList(shopGoodsGroupRecomm);
	}

	@Override
	public ShopGoodsGroupRecomm selectByTerm(ShopGoodsGroupRecomm shopGoodsGroupRecomm) throws Exception {
		
		return shopGoodsGroupRecommBiz.selectByTermAll(shopGoodsGroupRecomm);
	}

	@Override
	public void updateGroupRecomm(ShopGoodsGroupRecomm shopGoodsGroupRecomm) throws Exception {
		shopGoodsGroupRecommBiz.updateRecomm(shopGoodsGroupRecomm);
		
	}

}
